import type {IBrandBrief, IReviewItem, IReviewStat, ProductItemBriefType, ProductItemType} from "@/types/product";

export class ProductItemBriefCls implements ProductItemBriefType {
    id: number
    skuId: number
    name: string
    title: string
    summary: string
    price: number
    thumbCover: string
    brand: IBrandBrief
    status: string
    spec: string
    count: number | undefined
    sales: number | undefined

    constructor(id: number, skuId: number, name: string, title: string, summary: string, price: number, thumbCover: string, brand: IBrandBrief, status: string, spec: string, count: number | undefined, sales: number | undefined) {
        this.id = id
        this.skuId = skuId
        this.name = name
        this.title = title
        this.summary = summary
        this.price = price
        this.thumbCover = thumbCover
        this.brand = brand
        this.status = status
        this.spec = spec
        this.count = count
        this.sales = sales
    }
}

export class ProductItemCls implements ProductItemType{
    id: number
    skuId: number
    name: string // 商品名称
    title: string // 销售标题
    summary: string // 销售副标题
    price: number
    thumbCover: string
    brand: IBrandBrief
    status: string
    spec: string // 规格信息
    sales: number | undefined // 销量
    constructor(id: number, skuId: number, name: string, title: string, summary: string, price: number, thumbCover: string, brand: IBrandBrief, status: string, spec: string, sales: number | undefined) {
        this.id = id
        this.skuId = skuId
        this.name = name
        this.title = title
        this.summary = summary
        this.price = price
        this.thumbCover = thumbCover
        this.brand = brand
        this.status = status
        this.spec = spec
        this.sales = sales
    }
}

interface EditableType {
    sourceType: 'collect' | 'history'
}

export class EditableCl implements EditableType {
    sourceType: 'collect' | 'history'
    constructor(sourceType: 'collect' | 'history') {
        this.sourceType = sourceType
    }
}

export class ReviewCls {
    stat: IReviewStat
    list: Array<IReviewItem>

    constructor(stat: IReviewStat, list: Array<IReviewItem>) {
        this.stat = stat
        this.list = list
    }
}